package net.vkits.admin.domain.repository;

import net.vkits.admin.domain.model.Post;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;
import java.util.Optional;

/**
 * Created by ethan-liu on 2017/1/23.
 */
public interface PostRepository extends PagingAndSortingRepository<Post, Long> {
    Optional<Post> findById(Long id);
    List<Post> findAll();
    Page<Post> findByCellphoneOrVisibilityTrue(String cellphone, Pageable pageable);
    Page<Post> findByVisibilityTrue(Pageable pageable);
}
